<?php
namespace App\Controllers\Index;
use App\Models\Peizhi\Peizhi;
use App\Models\Goods\Goods;

/**
*	首页后台接口获取
*/
class Admin extends \App\Libs\Base\BaseAction
{
    protected function beforeRun() {
        parent::beforeRun();
        //$this->needLogin = TRUE;
    }
	
	public function execute(){
		$type = $this->request->get('type');
		if( empty( $type )){
			return \App\Libs\Views\Json::view(1, '请输入相关参数', '');	
		}	
		$peizhi = Peizhi::find('type='.$type);
		if( empty( $peizhi ) ){
			return \App\Libs\Views\Json::view(0, '成功', []);	
		}
		return \App\Libs\Views\Json::view(0, '成功', $peizhi);
	}
}
